
// const { Sequelize, DataTypes } = require("sequelize");

module.exports = (sequelize, DataTypes) => {
    const area = sequelize.define(
      'area',
      {// 在这里定义模型属性
        areaId: {
          type: DataTypes.INTEGER,
          primaryKey:true,
          autoIncrement:true,
          allowNull:false
        },
        areaName: {
          type: DataTypes.STRING,
          allowNull: false
        },
        areaPosition:{
          type: DataTypes.STRING,
          allowNull: false
        },
        areaStatus: {
          type: DataTypes.STRING,
          allowNull: false
        },
        areaLevel: {
          type: DataTypes.STRING,
          allowNull: false
        },
        coverUsers: {
          type: DataTypes.STRING,
          allowNull: false
        },
        handler: {
          type: DataTypes.STRING,
          allowNull: false
        },
        handlerAvator: {
          type: DataTypes.STRING,
          allowNull: false
        },
        handlerPhone: {
          type: DataTypes.STRING,
          allowNull: false
        }
      }, 
      {
      // 这是其他模型参数
      tableName: "area",//直接提供表名
      timestamps:true,
     }
    );
    return area
  }
  